JvnSentence_save.java

Go to the documentation of this file.
00001 
00004 package irc;
00005 
00006 /*import jvn.JvnException;
00007 import jvn.JvnServerImpl;
00008 import counter.IntegerWrapper;
00009 import counter.JvnIntegerWrapper;*/
00010 
00011 public class JvnSentence extends jvn.JvnObjectImpl implements java.io.Serializable {
00012 
00013     // Fields
00014     private Sentence __myJvnObject = null;
00015 
00016     // Constructors and methods, in the following order:
00017     // * Constructors
00018     // * @JvnRead methods
00019     // * @JvnWrite methods
00020     // * other methods
00021 
00022     private JvnSentence (java.io.Serializable o) {
00023         super(o);
00024         __myJvnObject = (Sentence)o;
00025     }
00026 
00027 
00028     public
00029     JvnSentence()
00030     throws jvn.JvnException
00031     {
00032         this((java.io.Serializable)(new Sentence()));
00033     }
00034 
00035 
00036     @jvn.NotNull() 
00037     public
00038     JvnSentence(@jvn.NotNull() java.util.ArrayList<java.lang.Object> param0, java.lang.String param1, @jvn.NotNull() int param2)
00039     throws java.lang.Exception, jvn.JvnException
00040     {
00041         this((java.io.Serializable)(new Sentence(param0, param1, param2)));
00042     }
00043 
00044 
00045     @jvn.JvnRead() 
00046     public
00047     java.lang.String
00048     read()
00049     throws jvn.JvnException
00050     {
00051         if (__myJvnObject != null) {
00052             java.lang.String returnVal;
00053             this.jvnLockRead();
00054             returnVal = __myJvnObject.read();
00055             this.jvnUnLock();
00056             return returnVal;
00057         }
00058         else {
00059             throw new jvn.JvnException("JvnSentence instance " + this + " not initialized !");
00060         }
00061     }
00062 
00063 
00064     @jvn.JvnWrite() 
00065     public
00066     void
00067     write(java.lang.String param0)
00068     throws jvn.JvnException
00069     {
00070         if (__myJvnObject != null) {
00071              this.jvnLockWrite();
00072             __myJvnObject.write(param0);
00073             this.jvnUnLock();
00074         }
00075         else {
00076             throw new jvn.JvnException("JvnSentence instance " + this + " not initialized !");
00077         }
00078     }
00079     
00080     /*static class JvnSentenceFactory {
00081         public static JvnSentence create(String name, Class c) {
00082                 JvnServerImpl js = JvnServerImpl.jvnGetServer();
00083                         
00084                         if (js == null) {
00085                                 System.err.println("Counter stress test problem : cannot create server!");
00086                                 return null;
00087                         }
00088                         else {
00089                                 // look up the IRC object in the JVN server
00090                                 // if not found, create it, and register it in the JVN server
00091                                 JvnIntegerWrapper jo = (JvnIntegerWrapper)(js.jvnLookupObject("Counter"));
00092                                 if (jo == null) {
00093                                         jo = (JvnIntegerWrapper)(js.jvnCreateObject(new JvnSentence()));
00094                                         // after creation, I have a write lock on the object
00095                                         jo.jvnUnLock();
00096                                         js.jvnRegisterObject("Counter", jo);
00097                                 }
00098                                 while(true) {
00099                                         try {
00100                                                 jo.jvnLockWrite();
00101                                                 int number = jo.read();
00102                                                 System.out.println("Current number is "+number+", next number shall be "+(++number));
00103                                                 jo.write(number);
00104                                                 jo.jvnUnLock();
00105                                         } catch (JvnException je) {
00106                                                 System.out.println("Counter stress test problem : " + je.getMessage());
00107                                         }
00108                                 }
00109                         }
00110                 return null;
00111         }
00112     }*/
00113 
00114 
00115 }

Generated on Wed Jan 2 10:15:54 2008 for Javanaise by  doxygen 1.5.4